<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>图片</title>
		<script>
			function changeImg(){
				document.getElementById("pic").setAttribute("src","../1-3/images/mai.jpg");
				let t=document.getElementById("tit");
				alert(t.align);
				alert(t.getAttribute("align"));
			}
		</script>
	</head>
	<body>
		<h1 id="tit">我和狗狗活下来了</h1>
		<img src="../1-3/images/dog.jpg" id="pic"/>
		<div>
			<button type="button" onclick="changeImg()">更换</button>
		</div>
	</body>
</html>